package model;

import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Collection;
import java.util.LinkedList;

public class Stanowisko extends Model {

	static public Collection<StanowiskoBean> getLista() throws SQLException  {
		PreparedStatement p = getConnection().prepareStatement( "select id,nazwa from Stanowisko");
		ResultSet r = p.executeQuery();
		LinkedList<StanowiskoBean> out =  new LinkedList<StanowiskoBean>();
		while(r.next()){
			out.add( new StanowiskoBean(r.getLong(1), r.getString(2)));
		}
		r.close();
		p.close();
		return out;
	}
	
}
